'use strict';

var __importDefault =
    (this && this.__importDefault) ||
    function (mod) {
        return mod && mod.__esModule
            ? mod
            : {
                  default: mod
              };
    };

exports.__esModule = true;
/*
  两种网络请求：postRequest => POST, getRequest => GET
  请求头header: 默认json，支持自定义({})或快速写入('form', 'json')
*/

var request_1 = require('../../utils/request');

var globalData_1 = require('../../globalData');

var marketingRequest = new request_1['default']({
    ApiUrl: globalData_1['default'].marketingUrl
}); //邀请奖励详情

exports.getInviteDetail = function (params) {
    return marketingRequest.postRequest({
        url: 'app/activitys/inviteDetail',
        data: params
    });
}; 
//邀请明细总计
exports.userInviteTotal = function (params) {
    return marketingRequest.postRequest({
        url: 'app/activitys/userInviteTotal',
        data: params
    });
}; //邀请明细列表

exports.userInviteRecord = function (params) {
    return marketingRequest.postRequest({
        url: 'app/activitys/userInviteRecord',
        data: params
    });
}; // 新客有礼活动-用户注册

exports.newUserRegister = function (params) {
    return marketingRequest.postRequest({
        url: 'app/activitys/newUserRegister',
        data: params
    });
}; // 【邀请奖励 - 邀请用户注册】

exports.inviteRewardRegister = function (params) {
    return marketingRequest.postRequest({
        url: 'app/activitys/inviteRewardRegister',
        data: params
    });
};
exports.getSpreadRuleType = function (taskType) {
    return marketingRequest.getRequest({
        url: `app/spread/user/getSpreadRule/${taskType}`
    });
};

//获取当前城市Id（活动）
exports.getActivityCityId = function (cityName) {
    return marketingRequest.getRequest({
        url: `app/user/account/getCityId/${cityName}`
    });
};